package com.springcloudalibaba.nacos.conf;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 定义配置类
 * 服务之间调用RestTemplate+Ribbon
 *
 * @author admin
 */
@Configuration
public class GenericConfiguration {
    /**
     * 创建RestTemplate，并交个Spring容器管理
     */
    @LoadBalanced
    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
